home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
- # postinst script for hal
- #
- # see: dh_installdeb(1)
-
- set -e
-
- # summary of how this script can be called:
- # * <postinst> `configure' <most-recently-configured-version>
- # * <old-postinst> `abort-upgrade' <new version>
- # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
- # <new-version>
- # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
- # <failed-install-package> <version> `removing'
- # <conflicting-package> <version>
- # for details, see http://www.debian.org/doc/debian-policy/ or
- # the debian-policy package
- #
- # quoting from the policy:
- # Any necessary prompting should almost always be confined to the
- # post-installation script, and should be protected with a conditional
- # so that unnecessary prompting doesn't happen if a package's
- # installation fails and the `postinst' is called with `abort-upgrade',
- # `abort-remove' or `abort-deconfigure'.
-
- case "$1" in
- configure)
- adduser --system \
- --quiet \
- --disabled-password \
- --no-create-home \
- --home "/var/run/hald" \
- --gecos "Hardware abstraction layer" \
- --group haldaemon
-
- # Remove old stop symlinks on upgrades
- if dpkg --compare-versions "$2" lt-nl "0.5.11-6"; then
- rm -f /etc/rc[06].d/K??hal
- fi
-
- # Update haldaemon home directory
- if dpkg --compare-versions "$2" lt-nl "0.5.12~git20090406.46dc48-1"; then
- usermod --home /var/run/hald haldaemon || true
- fi
-
- if [ -x /etc/init.d/dbus ]; then
- invoke-rc.d dbus force-reload || true
- fi
- ;;
- abort-upgrade|abort-remove|abort-deconfigure)
- ;;
- triggered)
- echo "Regenerating hal fdi cache ..."
- rm -f /var/cache/hald/fdi-cache
- restart hal || :
- exit 0
- ;;
- *)
- echo "postinst called with unknown argument \`$1'" >&2
- exit 1
- ;;
- esac
-
- # dh_installdeb will replace this with shell code automatically
- # generated by other debhelper scripts.
-
- # Automatically added by dh_installinit
- if [ -e "/etc/init/hal.conf" ]; then
- # start fails if already running
- start hal || :
- fi
- # End automatically added section
- # Automatically added by dh_installinit
- update-rc.d -f hal remove >/dev/null || exit $?
- # End automatically added section
-
-
- exit 0
-